import Cookies from 'js-cookie'

const TokenKey = 'Admin-gis-jcpt-Token'
const UseridKey = 'Admin-gis-jcpt-Userid'
const IdentityKey = 'Admin-gis-jcpt-Identity'

export function getToken() {
  return Cookies.get(TokenKey)
}

export function setToken(token) {
  return Cookies.set(TokenKey, token, { expires: new Date(Date.now() + 15 * 60 * 1000) })
}

export function removeToken() {
  return Cookies.remove(TokenKey)
}


export function getUserid() {
  return Cookies.get(UseridKey)
}

export function setUserid(userid) {
  return Cookies.set(UseridKey, userid, { expires: new Date(Date.now() + 15 * 60 * 1000) })
}

export function removeUserid() {
  return Cookies.remove(UseridKey)
}

export function getIdentity() {
  return Cookies.get(IdentityKey)
}

export function setIdentity(identity) {
  return Cookies.set(IdentityKey, identity, { expires: new Date(Date.now() + 15 * 60 * 1000) })
}

export function removeIdentity() {
  return Cookies.remove(IdentityKey)
}
